How to stop execution of a function which is triggered by a button click using another button in Rea